﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CadastroCliente.aspx.cs" Inherits="BookExpress.Cliente.CadastroCliente" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="../Scripts/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {

        $("#MainContent_CPFCNPJ").mask("999.999.999-99", { placeholder: "_" });

        $("#MainContent_TipoCliente_0").change(function () {
            $("#MainContent_CPFCNPJ").mask("999.999.999-99", { placeholder: "_" });
        });

        $("#MainContent_TipoCliente_1").change(function () {
            $("#MainContent_CPFCNPJ").mask("99.999.999/9999-99", { placeholder: "_" });
        });

        $("#MainContent_CEP").mask("99999-999", { placeholder: "_" });
        $("#MainContent_Telefone").mask("(99) 9999-9999", { placeholder: "_" });
        $("#MainContent_Celular").mask("(99) 9999-9999", { placeholder: "_" });
    });

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Cadastro de Clientes</h2>
    <p>
         
        <table style="width:100%;">
        <tr>
                <td colspan="2">
                    <asp:RadioButtonList ID="TipoCliente" runat="server">
                        <asp:ListItem Selected="True">Pessoa Física</asp:ListItem>
                        <asp:ListItem>Pessoa Jurídica</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    *Nome:<br />
                    <asp:TextBox ID="Nome" runat="server" Width="300px" MaxLength="80"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldNome" runat="server" 
                        ControlToValidate="Nome" ErrorMessage="Preencha o campo Nome." 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    *CPF/CNPJ:<br />
                    <asp:TextBox ID="CPFCNPJ" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldCPFCNPJ" runat="server" 
                        ControlToValidate="CPFCNPJ" ErrorMessage="Preencha o campo CPF/CNPJ." 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    *Logradouro:<br />
                    <asp:DropDownList ID="TipoLogradouro" runat="server">
                        <asp:ListItem Selected="True" Value="Selecione">Selecione</asp:ListItem>
                        <asp:ListItem>Rua</asp:ListItem>
                        <asp:ListItem>Avenida</asp:ListItem>
                        <asp:ListItem>Travessa</asp:ListItem>
                        <asp:ListItem>Alameda</asp:ListItem>
                        <asp:ListItem>Viela</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldTipoLogradouro" runat="server" 
                        ControlToValidate="TipoLogradouro" ErrorMessage="Preencha o campo Tipo de Logradouro." 
                        Display="None" InitialValue="Selecione"></asp:RequiredFieldValidator>
                    <asp:TextBox ID="Logradouro" runat="server" Width="655px" MaxLength="255"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldLogradouro" runat="server" 
                        ControlToValidate="Logradouro" ErrorMessage="Preencha o campo Logradouro" 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    *Número:<br />
                    <asp:TextBox ID="Numero" runat="server" Width="100px" MaxLength="5"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldNumero" runat="server" 
                        ControlToValidate="Numero" ErrorMessage="Preencha o campo Número." 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
                <td>
                    Complemento:<br />
                    <asp:TextBox ID="Complemento" runat="server" Width="160px" MaxLength="10"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    *Bairro:<br />
                    <asp:TextBox ID="Bairro" runat="server" Width="225px" MaxLength="45"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldBairro" runat="server" 
                        ControlToValidate="Bairro" ErrorMessage="Preencha o campo Bairro." 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
                <td>
                    *Cidade/UF:<br />
                    <asp:TextBox ID="Cidade" runat="server" Width="225px" MaxLength="45"></asp:TextBox>
                    <asp:DropDownList ID="UF" runat="server">
                        <asp:ListItem Selected="True">Selecione</asp:ListItem>
                        <asp:ListItem>AC</asp:ListItem>
                        <asp:ListItem>AL</asp:ListItem>
                        <asp:ListItem>AP</asp:ListItem>
                        <asp:ListItem>AM</asp:ListItem>
                        <asp:ListItem>BA</asp:ListItem>
                        <asp:ListItem>CE</asp:ListItem>
                        <asp:ListItem>DF</asp:ListItem>
                        <asp:ListItem>ES</asp:ListItem>
                        <asp:ListItem>GO</asp:ListItem>
                        <asp:ListItem>MA</asp:ListItem>
                        <asp:ListItem>MT</asp:ListItem>
                        <asp:ListItem>MS</asp:ListItem>
                        <asp:ListItem>MG</asp:ListItem>
                        <asp:ListItem>PA</asp:ListItem>
                        <asp:ListItem>PB</asp:ListItem>
                        <asp:ListItem>PR</asp:ListItem>
                        <asp:ListItem>PE</asp:ListItem>
                        <asp:ListItem>PI</asp:ListItem>
                        <asp:ListItem>RJ</asp:ListItem>
                        <asp:ListItem>RN</asp:ListItem>
                        <asp:ListItem>RS</asp:ListItem>
                        <asp:ListItem>RO</asp:ListItem>
                        <asp:ListItem>RR</asp:ListItem>
                        <asp:ListItem>SC</asp:ListItem>
                        <asp:ListItem>SP</asp:ListItem>
                        <asp:ListItem>SE</asp:ListItem>
                        <asp:ListItem>TO</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldCidade" runat="server" 
                        ControlToValidate="Cidade" ErrorMessage="Preencha o campo Cidade." 
                        Display="None"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldUF" runat="server" 
                        ControlToValidate="UF" ErrorMessage="Preencha o campo UF." 
                        Display="None" InitialValue="Selecione"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    *CEP:<br />
                    <asp:TextBox ID="CEP" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldCEP" runat="server" 
                        ControlToValidate="CEP" ErrorMessage="Preencha o campo CEP." 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
                <td>
                    *Telefone:<br />
                    <asp:TextBox ID="Telefone" runat="server" Width="160px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldTelefone" runat="server" 
                        ControlToValidate="Telefone" ErrorMessage="Preencha o campo Telefone." 
                        Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Celular:<br />
                    <asp:TextBox ID="Celular" runat="server" Width="160px"></asp:TextBox>
                </td>
                <td>
                    E-mail:<br />
                    <asp:TextBox ID="Email" runat="server" Width="225px" MaxLength="80"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionEmail" runat="server" 
                        ControlToValidate="Email" Display="None" 
                        ErrorMessage="Preencha um endereço de e-mail válido." 
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
                        ShowMessageBox="True" ShowSummary="False" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="BtnConfirmarCadastro" runat="server" 
                        OnClientClick="Javascript:if(Page_ClientValidate()){return confirm('Confirma cadastro?');}" 
                        onclick="BtnConfirmarCadastro_Click" Text="Confirmar" 
                        CausesValidation="False" />
                </td>
            </tr>
            </table>
         
    </p>
</asp:Content>
